home *** CD-ROM | disk | FTP | other *** search
/ Chip 2005 July / CHIP_CD_2005-07.iso / software / att / attsetup.exe / plugins / shared memory / Delphi / uMain.pas < prev   
Pascal/Delphi Source File  |  2005-02-13  |  3KB  |  87 lines

  1. unit uMain;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  7.   Dialogs, StdCtrls, ExtCtrls;
  8. type     PATTData=^TATTData;
  9.          TATTData=packed record
  10.          CurGPU:dword;      //Current GPU Speed
  11.          CurMEM:dword;      //Current MEM Speed
  12.          isGameActive:dword; //If game from profile is active, this field will be 1 or 0 if not.
  13.          is3DActive:dword;  //1=3D mode, 0=2D mode
  14.          isTempMonSupported:dword; //1 - if temperature monitoring supported by ATT
  15.          GPUTemp:dword;            //GPU Temperature
  16.          ENVTemp:dword;            //ENV Temperature
  17.          FanDuty:dword;            //FAN Duty
  18.          MAXGpuTemp:dword;        //MAX GPU Temperature
  19.          MINGpuTemp:dword;         //MIN GPU Temperature
  20.          MAXEnvTemp:dword;         //MAX ENV Temperature
  21.          MINEnvTemp:dword;         //MIN ENV Temperature
  22.                         //3d settings
  23.          CurD3DAA:dword;           //Direct3D Antialiasing value
  24.          CurD3DAF:dword;           //Direct3D Anisotropy value
  25.          CurOGLAA:dword;           //OpenGL Antialiasing value
  26.          CurOGLAF:dword;           //OpenGL Anisotropy value
  27.          end;
  28.  
  29. type
  30.   TfrmMain = class(TForm)
  31.     Memo1: TMemo;
  32.     Button1: TButton;
  33.     Timer1: TTimer;
  34.     procedure Button1Click(Sender: TObject);
  35.     procedure Timer1Timer(Sender: TObject);
  36.   private
  37.     { Private declarations }
  38.   public
  39.     { Public declarations }
  40.   end;
  41.  
  42. var
  43.   frmMain: TfrmMain;
  44.  
  45. implementation
  46.  
  47. {$R *.dfm}
  48.  
  49. procedure TfrmMain.Button1Click(Sender: TObject);
  50. begin
  51.      Close;
  52. end;
  53.  
  54. procedure TfrmMain.Timer1Timer(Sender: TObject);
  55. var hMapObject:THandle;
  56.     data:PATTData;
  57.     s1,s2:string;
  58. begin
  59.     hMapObject := OpenFileMapping(FILE_MAP_ALL_ACCESS,TRUE,'ATITRAY_SMEM');
  60.     if (hMapObject<>0)  then
  61.         begin
  62.         data := MapViewOfFile(hMapObject, FILE_MAP_WRITE, 0, 0, 0);
  63.         if (data<>nil)  then
  64.                 begin
  65.                      if (data.is3DActive=1) then s1:='3D' else s1:='2D';
  66.                      if (data.isTempMonSupported=1) then s2:='Yes' else s2:='No';
  67.             Memo1.Lines.Text:=format('GPU Speed - %dMHz'^m+
  68.                 'MEM Speed - %dMHz'^m+
  69.                 'Current Mode - %s'^m+
  70.                 'Temperature Monitor Supported - %s'^m+
  71.                 'GPU Temperature - %d'^m+
  72.                 'ENV Temperature - %d'^m,
  73.                 [data.CurGPU, data.CurMEM,
  74.                                 s1,s2,data.GPUTemp,data.ENVTemp]);
  75.             UnmapViewOfFile(data);
  76.             CloseHandle(hMapObject);
  77.  
  78.         end else  Memo1.Lines.Text:='Error getting ATI Tray Shared Memory Information';
  79.     end else
  80.         begin
  81.         Memo1.Lines.Text:='ATI Tray Tools not found';
  82.         end;
  83.  
  84. end;
  85.  
  86. end.
  87.